Skip to content

SK-2870: Upgrade Android SDK dependencies to modern stable versions#185

Open
saileshwar-skyflow wants to merge 7 commits into
mainfrom
SK-2870-upgrade-android-sdk-dependencies
Open

SK-2870: Upgrade Android SDK dependencies to modern stable versions#185
saileshwar-skyflow wants to merge 7 commits into
mainfrom
SK-2870-upgrade-android-sdk-dependencies

Conversation

@saileshwar-skyflow

@saileshwar-skyflow saileshwar-skyflow commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Why

The SDK's build toolchain and dependencies had not been updated since 2021–2022. Key issues:

  • AGP 7.4.2 and Gradle 7.6 are EOL and incompatible with JDK 17+ CI environments
  • Multiple dependencies had known CVEs (OkHttp 4.9.0, @babel/core via github-script@v6)
  • Stale Kotlin plugin entries and a wildcard core-ktx:+ dependency caused version conflicts
  • CI workflows used deprecated GitHub Actions versions (checkout@v2, setup-java@v1)

Goal

  • Upgrade AGP 7.4.2 to 9.2.0 and Gradle wrapper 7.6 to 9.4.1
  • Upgrade core-ktx 1.6.0 to 1.16.0, OkHttp 4.9.0 to 4.12.0, material 1.4.0 to 1.12.0, robolectric 4.6.1 to 4.14.1, mockk 1.8.5 to 1.14.11
  • Bump compileSdk/targetSdk 31 to 35 and Java compatibility VERSION_1_8 to VERSION_17
  • Remove unused dependencies: appcompat, constraintlayout, gson, coroutines, mockito, espresso, duplicate robolectric in androidTest, kotlin-stdlib-jdk7
  • Fix CVE-2023-45133 (CRITICAL) by upgrading github-script v6 to v7 in Semgrep workflow
  • Upgrade all CI GitHub Actions to current major versions with Temurin JDK 17
  • Zero customer-facing API surface change — all deps are implementation scope, not api

Testing

  • CI build passes: :Skyflow:build, :Skyflow:lint, :Skyflow:test all green
  • All existing unit tests pass with no changes to test logic
  • Verified on AGP 9.2.0 + Gradle 9.4.1 + JDK 17 (Temurin) in CI

- AGP 7.4.2 → 9.2.0; Gradle wrapper 7.6 → 9.4.1
- Kotlin plugin cleanup: remove stale ext.kotlin_version=1.6.0-M1, duplicate
  kotlin-gradle-plugin classpath, and android-maven-gradle-plugin (obsolete)
- compileSdk/targetSdk 31 → 35; compileOptions VERSION_1_8 → VERSION_17;
  migrate kotlinOptions to kotlin { compilerOptions {} } DSL (AGP 9 requirement)
- core-ktx 1.6.0 → 1.16.0; okhttp 4.9.0 → 4.12.0 (security patches);
  robolectric 4.6.1 → 4.14.1; mockk 1.8.5 → 1.14.11
- Remove unused SDK deps: appcompat, material, constraintlayout, gson,
  coroutines-android, kotlin-stdlib-jdk7, mockito-core, espresso-core,
  duplicate robolectric in androidTest scope
- samples: remove resolutionStrategy force on core-ktx:1.6.0, remove
  dangerous core-ktx:+ wildcard; upgrade appcompat→1.7.0, material→1.12.0,
  constraintlayout→2.2.1, coroutines→1.8.1
- CI: all workflows upgraded to actions/checkout@v4, setup-java@v4 with
  Temurin JDK 17 (AGP 9 requires JDK 17 minimum), wrapper-validation→v3;
  github-script@v6→v7 (fixes CVE-2023-45133 @babel/core CRITICAL)
- .gitignore: add /android to ignore CucumberTestingAndroid directory
- settings.gradle: add missing include ':samples' module

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

….gradle

AGP plugins (com.android.library, com.android.application) live on Google
Maven, not the Gradle Plugin Portal. Without a pluginManagement block,
Gradle's plugins {} DSL only searches the Plugin Portal and fails to resolve
them. Adding pluginManagement with google() + mavenCentral() + gradlePluginPortal()
fixes the CI build failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

- samples: guard local.properties load with file.exists() check so CI
  builds without local.properties no longer throw FileNotFoundException
- samples: add namespace "com.Skyflow" (AGP 9 requires namespace in build.gradle)
- samples: add buildFeatures.buildConfig = true (AGP 8+ disables BuildConfig
  generation by default; samples uses buildConfigField in debug build type)
- Skyflow: add namespace "com.skyflow_android" (same AGP 9 requirement)
- Skyflow: add buildFeatures.buildConfig = true (uses buildConfigField for
  SDK_NAME and SDK_VERSION in both release and debug build types)
- Skyflow: declare android.publishing.singleVariant('release') with
  withSourcesJar() — required by AGP 8+ for components.release to be
  available in afterEvaluate publishing block
- Skyflow: remove manual androidSourcesJar task (superseded by withSourcesJar())
- gradle.properties: remove android.enableJetifier=true (deprecated in AGP 9,
  removed in AGP 10; SDK uses only AndroidX, Jetifier not needed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

- Replace String.toLowerCase() with String.lowercase() in TextField.kt
  (lines 256, 257, 273, 274) and SkyflowValidateExpireDate.kt (line 39):
  toLowerCase() was deprecated in Kotlin 1.5 and elevated to ERROR level
  in Kotlin 1.9+; K2 compiler now fails the build on these calls
- Remove package= attribute from Skyflow and samples AndroidManifest.xml:
  AGP 9 ignores the package attribute in source manifests (namespace is
  now declared in build.gradle); leaving it generates a build warning

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

…operties

These flags require migrating all R class references across the codebase
before they can be enabled. The samples module references R.font.roboto_light
which is defined in the :Skyflow module; with nonTransitiveRClass=true that
reference becomes unresolved. Enabling these flags is a separate migration
task, not part of this dependency upgrade.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

samples module references font resources from the SDK module which
are not accessible in AGP 9 without complex resource duplication.
CI validates the SDK library, not the samples demo app.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

The Skyflow module styles.xml uses Material TextInputLayout attributes
(boxStrokeColor, boxBackgroundColor), so material is a required runtime
dependency. Upgrade from 1.4.0 to 1.12.0 (latest stable).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

Gitleaks Findings: No secrets detected. Safe to proceed!

@github-actions

Copy link
Copy Markdown

Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant